home *** CD-ROM | disk | FTP | other *** search
- property pOrigMemNum, pPressed, pAnswerNum, pKey
-
- on getPropertyDescriptionList me
- list = [:]
- addProp(list, #pAnswerNum, [#comment: "Answer Number", #format: #integer, #default: 1])
- addProp(list, #pKey, [#comment: "Key", #format: #string, #default: EMPTY])
- return list
- end
-
- on beginSprite me
- pOrigMemNum = sprite(me.spriteNum).memberNum
- pPressed = 0
- end
-
- on makeVisible me
- sprite(me.spriteNum).memberNum = pOrigMemNum
- end
-
- on mouseDown me
- pPressed = 1
- sprite(me.spriteNum).memberNum = pOrigMemNum + 1
- end
-
- on mouseUp me
- if pPressed <> 1 then
- exit
- end if
- pPressed = 0
- sprite(me.spriteNum).memberNum = pOrigMemNum
- if not sendSprite(0, #clickAnswer, pAnswerNum) then
- sprite(me.spriteNum).memberNum = 0
- end if
- end
-
- on mouseUpOutSide me
- pPressed = 0
- sprite(me.spriteNum).memberNum = pOrigMemNum
- end
-
- on keyHit me, key
- if key = pKey then
- if not sendSprite(0, #clickAnswer, pAnswerNum) then
- sprite(me.spriteNum).memberNum = 0
- end if
- end if
- end
-